#ifndef ANDQUERY_H
#define ANDQUERY_H
#include "BinaryQuery.h"
#include <memory>
using std::shared_ptr; using std::make_shared;
#include <set>
#include <algorithm>

class AndQuery: public BinaryQuery{
    friend Query operator& (const Query&,const Query&);
    AndQuery(const Query &left,const Query &right):BinaryQuery(left,right,"&"){}
    //具体的类:AndQuery继承了rep并且定义了其他纯虚函数
    QueryResult eval(const TextQuery&) const ;
};
inline Query operator& (const Query &lhs,const Query &rhs){
    // if(DEBUG) cout << "AndQuery(" << lhs.rep() << "," << rhs.rep() << ") constructed" << endl;
    return shared_ptr<Query_base>(new AndQuery(lhs,rhs));
}

#endif 